/*
 * TcpSessionManager.h
 *
 *  Created on: 21/08/2011
 *      Author: george
 */

#ifndef TCPSESSIONMANAGER_H_
#define TCPSESSIONMANAGER_H_

#include "tcpsessionmanager.h"
#include "tcpsession.h"

#include <vector>
#include <exception>

class NoTcpSessionException: public std::exception{
	public:
	virtual const char *what(){
		return "Sessão TCP não encontrada";
	}
};

class TcpSessionManager {
public:
	std::vector <TcpSession*> session;
	tcp_hdr_t  *tcp_header;

	TcpSessionManager();
	bool add(ip_hdr_t* ip,  tcp_hdr_t* tcp);
	long getSession(in_addr src, in_addr dst, u_int16_t src_port, u_int16_t dst_port, u_int8_t protocol);
};

#endif /* TCPSESSIONMANAGER_H_ */
